import {reqCategoryList} from '@/api'

// home模块小仓库
const state = {
    // 初始化数据时，不要瞎写
    categoryList:[]
};
const actions = {
    async categoryListAction({commit}){
        let result = await reqCategoryList()
        if(result.code === 200){
            commit('CATEGORYLISTMUTATION',result.data)
        }
    }
};
const mutations = {
    CATEGORYLISTMUTATION(state,categoryList){
        state.categoryList = categoryList
    }
};
const getters = {};

export default {
    namespaced: true,
    state,
    actions,
    mutations,
    getters
}